home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / include / ds5000.md / sys / RCS / exec.h,v < prev    next >
Encoding:
Text File  |  1990-02-16  |  6.8 KB  |  283 lines

  1. head     1.4;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.4
  10. date     90.02.16.14.07.56;  author rab;  state Exp;
  11. branches ;
  12. next     1.3;
  13.  
  14. 1.3
  15. date     89.10.12.13.10.19;  author douglis;  state Exp;
  16. branches ;
  17. next     1.2;
  18.  
  19. 1.2
  20. date     89.07.31.14.26.06;  author rab;  state Exp;
  21. branches ;
  22. next     1.1;
  23.  
  24. 1.1
  25. date     89.07.19.16.32.45;  author rab;  state Exp;
  26. branches ;
  27. next     ;
  28.  
  29.  
  30. desc
  31. @@
  32.  
  33.  
  34. 1.4
  35. log
  36. @Fixed include path so this file can be used by cross-compilers.
  37. @
  38. text
  39. @/*     @@(#)exec.h    4.1.1.2    (ULTRIX)    7/7/88     */
  40.  
  41. /************************************************************************
  42.  *                                    *
  43.  *            Copyright (c) 1986 by                *
  44.  *        Digital Equipment Corporation, Maynard, MA        *
  45.  *            All rights reserved.                *
  46.  *                                    *
  47.  *   This software is furnished under a license and may be used and    *
  48.  *   copied  only  in accordance with the terms of such license and    *
  49.  *   with the  inclusion  of  the  above  copyright  notice.   This    *
  50.  *   software  or  any  other copies thereof may not be provided or    *
  51.  *   otherwise made available to any other person.  No title to and    *
  52.  *   ownership of the software is hereby transferred.            *
  53.  *                                    *
  54.  *   This software is  derived  from  software  received  from  the    *
  55.  *   University    of   California,   Berkeley,   and   from   Bell    *
  56.  *   Laboratories.  Use, duplication, or disclosure is  subject  to    *
  57.  *   restrictions  under  license  agreements  with  University  of    *
  58.  *   California and with AT&T.                        *
  59.  *                                    *
  60.  *   The information in this software is subject to change  without    *
  61.  *   notice  and should not be construed as a commitment by Digital    *
  62.  *   Equipment Corporation.                        *
  63.  *                                    *
  64.  *   Digital assumes no responsibility for the use  or  reliability    *
  65.  *   of its software on equipment which is not supplied by Digital.    *
  66.  *                                    *
  67.  ************************************************************************/
  68. /*
  69.  *
  70.  *   Modification History:
  71.  *
  72.  * 03 Nov 87 -- map
  73.  *    Change magic number definition for compatibility modes.
  74.  * 02 Apr 86 -- depp
  75.  *    New file
  76.  *
  77.  */
  78.  
  79. /*
  80.  *    @@(#)exec.h    1.2 (Berkeley) 6/8/85
  81.  */
  82.  
  83. #ifndef _EXEC
  84. #define _EXEC
  85.  
  86. #if 0
  87.  /* these are defined in <aouthdr.h> */
  88. #define    OMAGIC    0407        /* old impure format */
  89. #define    NMAGIC    0410        /* read-only text */
  90. #define    ZMAGIC    0413        /* demand load format */
  91. #endif
  92.  
  93. /*
  94.  *    Compatibility modes
  95.  */
  96. #define    A_BSD    0        /* All pre V2.4 a.outs and BSD */
  97. #define    A_SYSV    1        /* SVID compliant process */
  98. #define    A_POSIX 2        /* IEEE P1003.1 compliant process */
  99.  
  100. #include <ds3100.md/filehdr.h>
  101. #include <ds3100.md/aouthdr.h>
  102. #include <ds3100.md/scnhdr.h>
  103.  
  104. #ifdef notdef
  105. struct filehdr {
  106.     unsigned short    f_magic;    /* magic number */
  107.     unsigned short    f_nscns;    /* number of sections */
  108.     long        f_timdat;    /* time & date stamp */
  109.     long        f_symptr;    /* file pointer to symbolic header */
  110.     long        f_nsyms;    /* sizeof(symbolic hdr) */
  111.     unsigned short    f_opthdr;    /* sizeof(optional hdr) */
  112.     unsigned short    f_flags;    /* flags */
  113. };
  114.  
  115. struct aouthdr {
  116.     short    magic;        /* see magic.h                */
  117.     short    vstamp;        /* version stamp            */
  118.     long    tsize;        /* text size in bytes, padded to FW
  119.                    bdry                    */
  120.     long    dsize;        /* initialized data "  "        */
  121.     long    bsize;        /* uninitialized data "   "        */
  122.     long    entry;        /* entry pt.                */
  123.     long    text_start;    /* base of text used for this file    */
  124.     long    data_start;    /* base of data used for this file    */
  125.     long    bss_start;    /* base of bss used for this file    */
  126.     long    gprmask;    /* general purpose register mask    */
  127.     long    cprmask[4];    /* co-processor register masks        */
  128.     long    gp_value;    /* the gp value used for this object    */
  129. };
  130.  
  131. struct scnhdr {
  132.     char        s_name[8];    /* section name */
  133.     long        s_paddr;    /* physical address */
  134.     long        s_vaddr;    /* virtual address */
  135.     long        s_size;        /* section size */
  136.     long        s_scnptr;    /* file ptr to raw data for section */
  137.     long        s_relptr;    /* file ptr to relocation */
  138.     long        s_lnnoptr;    /* file ptr to line numbers (not used)*/
  139.     unsigned short    s_nreloc;    /* number of relocation entries */
  140.     unsigned short    s_nlnno;    /* number of line numbers (not used) */
  141.     long        s_flags;    /* flags */
  142. };
  143. #endif /* notdef */
  144.  
  145. struct exec {
  146.     struct filehdr    ex_f;
  147.     struct aouthdr    ex_o;
  148. };
  149.  
  150. /*
  151.  * Coff files produced by the mips loader are guaranteed to have the raw data
  152.  * for the sections follow the headers in this order: .text, .rdata, .data and
  153.  * .sdata the sum of the sizes of last three is the value in dsize in the
  154.  * optional header.  This is all done for the benefit of the programs that
  155.  * have to load these objects so only the file header and optional header
  156.  * have to be inspected.  The macro N_TXTOFF() takes pointers to file header
  157.  * and optional header and returns the file offset to the start of the raw
  158.  * data for the .text section.  The raw data for the three data sections
  159.  * follows the start of the .text section by the value of tsize in the optional
  160.  * header.
  161.  */
  162. #if 0
  163.  /* these are already defined in aouthdr.h and filhdr.h */
  164. #define    FILHDR    struct filehdr
  165. #define    FILHSZ    sizeof(FILHDR)
  166. #define    AOUTHSZ    sizeof(struct aouthdr)
  167. #define    SCNHSZ    sizeof(struct scnhdr)
  168. #endif
  169. /* SCNROUND is the size that sections are rounded off to */
  170. #define SCNROUND ((long)16)
  171.  
  172. #define N_TXTOFF(f, a) \
  173.  ((a).magic == ZMAGIC ? 0 : \
  174.   ((a).vstamp < 23 ? \
  175.    ((FILHSZ + AOUTHSZ + (f).f_nscns * SCNHSZ + 7) & 0xfffffff8) : \
  176.    ((FILHSZ + AOUTHSZ + (f).f_nscns * SCNHSZ + SCNROUND-1) & ~(SCNROUND-1)) ) )
  177.  
  178. /*
  179.  * for vax compatibility
  180.  */
  181. #define a_data    ex_o.dsize
  182. #define a_text    ex_o.tsize
  183. #define a_bss    ex_o.bsize
  184. #define a_entry    ex_o.entry
  185. #define a_magic    ex_o.magic
  186.  
  187. #ifdef LANGUAGE_C
  188. #define  MIPSEBMAGIC    0x0160
  189. #define  MIPSELMAGIC    0x0162
  190. #endif
  191.  
  192. #ifdef LANGUAGE_PASCAL
  193. #define  MIPSEBMAGIC    16#0160
  194. #define  MIPSELMAGIC    16#0162
  195. #endif
  196.  
  197. #ifdef MIPSEL
  198. #define OBJMAGIC    MIPSELMAGIC
  199. #endif
  200. #ifdef MIPSEB
  201. #define OBJMAGIC    MIPSEBMAGIC
  202. #endif
  203.  
  204. #endif /* _EXEC */
  205. @
  206.  
  207.  
  208. 1.3
  209. log
  210. @an attempt at fixing vax-isms.  doesn't seem to work yet but i'm checking it
  211. in to give rab a crack.
  212. @
  213. text
  214. @d48 2
  215. d53 1
  216. d62 4
  217. a65 3
  218. #include <filehdr.h>
  219. #include <aouthdr.h>
  220. #include <scnhdr.h>
  221. d124 2
  222. d130 1
  223. @
  224.  
  225.  
  226. 1.2
  227. log
  228. @*** empty log message ***
  229. @
  230. text
  231. @a46 16
  232. #ifdef vax
  233. /*
  234.  * Header prepended to each a.out file.
  235.  */
  236. struct exec {
  237. unsigned short    a_magic;    /* magic number */
  238. unsigned short    a_mode;        /* mode parameter */
  239. unsigned long    a_text;        /* size of text segment */
  240. unsigned long    a_data;        /* size of initialized data */
  241. unsigned long    a_bss;        /* size of uninitialized data */
  242. unsigned long    a_syms;        /* size of symbol table */
  243. unsigned long    a_entry;    /* entry point */
  244. unsigned long    a_trsize;    /* size of text relocation */
  245. unsigned long    a_drsize;    /* size of data relocation */
  246. };
  247. #endif /* vax */
  248. d59 4
  249. a62 2
  250. #ifdef mips
  251.  
  252. d101 1
  253. a158 1
  254. #endif /* mips */
  255. @
  256.  
  257.  
  258. 1.1
  259. log
  260. @Initial revision
  261. @
  262. text
  263. @d45 2
  264. d62 1
  265. a62 1
  266. #endif vax
  267. d158 2
  268. a159 1
  269. #endif LANGUAGE_C
  270. d163 1
  271. a163 1
  272. #endif LANGUAGE_PASCAL
  273. d167 1
  274. a167 1
  275. #endif MIPSEL
  276. d170 1
  277. a170 1
  278. #endif MIPSEB
  279. d172 2
  280. a173 1
  281. #endif mips
  282. @
  283.